<template>
    <div>
        <i-table :columns="columns1" :data="data1"></i-table>
    </div>
</template>
<script>
    export default {
        props:{
            companyid:{ type: String, required: true },
        },
        data () {
            return {
                columns1: [
                    {
                        title: '已开通产品',
                        key: 'product_name'
                    },
                    {
                        title: '产品接入编码',
                        key: 'product_code'
                    },
                    {
                        title: '授权价格',
                        key: 'money'
                    }
                ],
                data1: [
                ]
            }
        },
        methods: {
            getData(){
                console.log(this.store.state.user.companyId)
                this.$http.jsonp(this.path+'company/companyDownServlet/toCompanyProductPage',{
                    params:{companyCode:this.companyid,},
                    jsonp:'callback'
                }).then(
                    (datas)=>{
                        console.log(datas);
                        if(datas.body.code=='001'){
                            this.data1=datas.body.result.rowsList;
                        }else if(datas.body.code=='002'){
                            this.$Message.success('提交信息出错pp!');
                        }else{
                            this.$Message.success('奇怪错误!');
                        }
                    },
                    (error)=>{
                        this.$Message.success('网络问题!');
                    }   
                 );
            }
        },
        ready(){
            this.$nextTick(()=>{
                this.getData();
            })
        }
    }
</script>
<style>
    .ivu-table-sort, th .ivu-table-cell{
        width: 100%;
    }
    .ivu-table th{

    }
</style>